<!--
   - main.html
   -
   - Main menu of the application. Displayed after logging in.
   -
-->
{% extends "base.html" %}

{% block script %}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="https://browserid.org/include.js" type="text/javascript"></script>
{% endblock %}

{% block title %} Welcome to Photo Album! {% endblock %}



<!-- main content -->
{% block main_content %}
    <!-- welcome the user, if authenticated -->
    {% if request.user.is_authenticated %}
        <h2>Welcome {{ request.user.username }}!</h2>
    {% else %}
        <h2>Welcome to PhotoAlbum</h2>

    {% endif %}

    <!-- regular descriptive text of the website for everybody -->
    <p>
        Be the first one to comment and rate on the
        coolest photos.
    </p>
    <p><br /></p>

    <!-- let new users to easily join our network -->
    {% if not request.user.is_authenticated %}
    <p>
        If you already have an account on PhotoAlbum, just <a href="/signin">sign
        in</a> and view your photos.
    </p>
    
    <p>
        If you don't have yet an account on PhotoAlbum, <a href="/signup">sign up
        right now</a> and start creating your albums.
    </p>
	<br/>
    {% endif %}
    
    <h1>Facebook OAUTH2 Test Project</h1>
    {% if user.is_authenticated %}
    <h2>You are logged in as: {{ user }}</h2>
    <a href="/logout">Logout</a>
    <hr />
    <h2>User info</h2>
    <img src="http://graph.facebook.com/{{ user.get_profile.facebook_id }}/picture" /><br />
    <pre>{{ facebook_profile|pprint }}</pre>
    {% else %}
    <a href="/facebook/login">Login via Facebook</a>
    {% endif %}
    <hr />
    <a href="/admin">Admin</a>
{% endblock %}
